package com.ln.prac.lianglianglee.jvm;

/**
 * MovingAverage
 *
 * @Author zhangj
 * @Date 2023/2/11 00:02
 */
public class MovingAverage {
    private int count = 0;
    private double sum = 0.0D;
    public void submit(double value){
        this.count ++;
        this.sum += value;
    }
    public double getAvg(){
        if(0 == this.count){ return sum;}
        return this.sum/this.count;
    }
}
